package leetcode_day._2021._202103;

/**
 * @author yzh
 * @data 2021/3/19 17:47
 * 设计停车系统
 */
public class _19_1603 {

    static class ParkingSystem {
        int big, medium, small;

        public ParkingSystem(int big, int medium, int small) {
            this.big = big;
            this.medium = medium;
            this.small = small;
        }

        public boolean addCar(int carType) {
            switch(carType) {
                case 1: if (--this.big < 0) {
                    return false;
                } break;
                case 2: if (--this.medium < 0) {
                    return false;
                }break;
                case 3: if (--this.small < 0) {
                    return false;
                }break;
            }
            return true;
        }
    }
}
